import { _decorator, Component, director, Node, ProgressBar, resources } from 'cc';
import EventManager from '../../Runtime/EventManger';
import { CONTROLLER_ENUM, EVENT_ENUM, SCENE_ENUM } from '../../Enums';
import FaderManager from '../../Runtime/FaderManager';
const { ccclass, property } = _decorator;

@ccclass('LoadingManager')
export class LoadingManager extends Component {
  @property(ProgressBar)
  bar:ProgressBar=null
  onLoad(){
    resources.preloadDir("texture",(cur,total)=>{
      this.bar.progress=cur/total
    },()=>{
      director.loadScene(SCENE_ENUM.Start)
    })
  }
}

